from flask import Blueprint

from modules.amis.component.base import Option
from modules.amis.component.datainput import InputText
from modules.amis.component.layout import Divider, Page

user_bp = Blueprint("user", __name__)


@user_bp.route("/list", methods=["GET"])
def user_list_page():
    user_name_input = InputText(
        name="user_name",
        label="用户名",
        clearable=True,
        options=[Option("a", "a"), Option("b", "b")],
    )
    divider = Divider()
    user_sex_input = InputText(
        name="user_sex",
        label="性别",
        clearable=True,
        options=[Option("a", "a"), Option("b", "b")],
    )
    return Page(title="测试", body=[user_name_input, divider]).render()
    # return Page(title="test", body={
    #     "type": 'input-text',
    #     "label": "asdfasdf",
    # }).render()
